<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Subscribers'); ?></div>
    <h2>Email Subscriptions</h2>
    <p>Send a Newsletter to one or several Mailing Lists</p>
       
    <form method="get" id="form" enctype="multipart/form-data">
    <fieldset>
		<legend>Filter</legend>
        <div class="filter-row">
        	<label>Email: </label>
            <input type="text" name="keyword" value="<?php echo $args['keyword']; ?>">
        </div>      
        <div style="clear:both; text-align:center">
            <input type="submit" value="Search" /> 
            <input type="reset" name="Clear">
        </div>
    </fieldset>			
    </form>
    <div class="entry">
        <div class="sep"></div>
    </div>
    <table>
        <thead>
            <tr>
            	<th scope="col" class="chb"><input type="checkbox" onclick="selectAll(this);"></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Subject');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Description');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Created');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Modified');?></th>
            </tr>
        </thead>
            
        <tbody>
        
        <?php if(!empty($arrEmails)):?>
			<?php foreach($arrEmails as $i=>$R):?>
            <tr>
                <td class="align-center"><input type="checkbox"></td>
                <td>
					<?php echo $R['mail_subject']; ?>
                	<p style="margin:0; padding: 2px 0 0;">
                        <a href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS.'/preview/?id='.$R['mail_id']; ?>"  title="Preview">Preview</a> | 
                        <a href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS.'/editEmail/?id='.$R['mail_id']; ?>"  title="Edit">Edit</a> | 
                        <a href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS.'/deleteEmail/?id='.$R['mail_id']; ?>" title="Delete">Delete</a> 
                    </p>
                </td>
                <td><?php echo $R['mail_description']; ?></td>
                <td><?php echo $R['mail_created_date']; ?></td>
                <td><?php echo $R['mail_last_modified_date']; ?></td>
            </tr>
            <?php endforeach; ?>
		<?php else: ?>
            <tr>
                <td colspan="7">No data found!</td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
    <div class="entry">
        <?php /*$this->widget('CLinkPager', array(
			'currentPage'=>$objPages->getCurrentPage()-1,
			'pages' => $objPages,
		))*/ ?>
        <?php $this->widget('Pagination', array(
			'pages' => $objPages,
		)) ?>
        <div class="sep"></div>		
        <a class="button add" href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS.'/editEmail'; ?>"><?php echo Yii::t('AdmincpModule.admincp', 'Add New'); ?></a>
        <a class="button" href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS.'/lists'; ?>"><?php echo Yii::t('AdmincpModule.admincp', 'Lists'); ?></a>  
    </div>
</div>